close all;
clear all;
clc;

%define grid
Sx=1;  %physical size along x
Sy=1;  %physical size along y
Nx=20; %number of cells along x
Ny=20; %number of cells along x


% grid arrays
dx = Sx/Nx;
xa =[0:Nx-1]*dx;
xa = xa - mean(xa);

dy = Sy/Ny;
ya = [0:Ny-1]*dy;
ya = ya - mean(ya);

[Y,X] = meshgrid(ya,xa);

% define two poionts
x1 = -0.5;
y1 = +0.25;
x2 = +0.50;
y2 = -0.25;

% fill half space
m = (y2-y1)/(x2-x1);
A=(Y-y1)-m*(X-x1)>0;
A'



